﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Microsoft.Extensions.DependencyInjection;
namespace ST.Core.Util
{
    public static class ServicesUtil
    {
        public static IServiceProvider Services;

        public static T GetScopeRequiredService<T>() where T :   notnull
        {
            
            var scope = Services.CreateScope();
             var t = scope.ServiceProvider.GetRequiredService<T>();
            return t;
        }
         

    }
}
